"use strict"

/**
 * 河北省政府采购中心
 *  
 */

var Base = require("./base");
var hbscg_spider = new Base();
hbscg_spider.page = 3;
hbscg_spider.name = "河北省政府采购中心";
hbscg_spider.contentType = "text";

hbscg_spider.getPageUrl = function (pg) {
    return "http://www.ccgp-hebei.gov.cn/zfcg/web/getBidingList_" + pg + ".html";
};

hbscg_spider.getItems = function (data) {
    var items = [];
    var reg = new RegExp("onclick=\"watchContent\\('(\\d+)'[\\s\\S]+? class='a3'>(.*?)<\/a>", "ig");
    var regv;
    while (regv = reg.exec(data)) {
        var id = regv[1];
        var title = regv[2];
        var item = {};
        item.title = title;
        item.url = "http://www.ccgp-hebei.gov.cn/zfcg/1/bidingAnncDetail_" + id + ".html";
        item.source = hbscg_spider.name;
        items.push(item);
    }
    return items;
};

exports = module.exports = hbscg_spider;